<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title>Excursiones</title>
	<script type="text/javascript" src="/funciones.js"></script>
	<link href="../../default.css" rel="stylesheet" type="text/css" />

</head>

<body>

<table>
<tr>

<?php

$eid=$_GET['eid'];

$connection=mysql_connect("localhost","root","root",false,196608);
mysql_select_db("piaimu",$connection);

$query=mysql_query("SELECT id_foto, path_foto_ld FROM foto WHERE id_excursion=$eid AND act_foto='1';",$connection);
$rows=mysql_num_rows($query);

$colsLeft=4;
for($i=0;$i<$rows;)
{
	if($colsLeft==0)
	{
		echo "</tr><tr>";
		$colsLeft=4;
	}
	else
	{
		echo "<td><a href='detallesfoto.php?fid=" . mysql_result($query,$i,0) . "'><img src='../" . mysql_result($query,$i,1) . "' width='180' height='180' /></a></td>";
		$colsLeft--; $i++;
	}
}

?>

</tr>
</table>

</body>
</html>
